<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <title>志愿推荐</title>
    <link href="${ctxStatic}/bootstrap/3.3.2/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="${ctxStatic}/app/css/master.css">
    <style>
        #scoreModal .modal-dialog{
            margin-top: 40%;
            margin-left: 20%;
            width: 60%;
        }
    </style>
</head>
<body>
<input type="hidden" name="userId" id="userId" value="${user.id}" />
<div class="wrap">
    <section class="scorebg">
        <div class="scorebox" onclick="changeScore('${user.id}');">
            <p><i class="score">${user.gkScore}</i><sup>分</sup></p>
            <span>点击设置分数</span>
        </div>
    </section>
    <section class="selectbox">
        <ul class="content clearfix">
            <li>湖南</li>
            <li><a href="${wechat}/userCenter" style="color: #fff;">${fns:getDictLabel(user.kmType,'kemu_type','文史类')}</a></li>
            <li><a href="${wechat}/userCenter" style="color: #fff;">${fns:getDictLabel(user.batchLevel,'batch_level','本科')}</a></li>
        </ul>
    </section>
    <section class="typebox">
        <!--
        <c:choose>
            <c:when test="${flag eq 'success'}">
                <c:forEach items="${volunteerList}" var="volunteer">
                    <c:choose>
                        <c:when test="${volunteer.vtype eq 'safely'}">
                            <c:set var="safely" value=""/>
                            <c:forEach items="${volunteer.volunteerSchoolList}" var="volunteerSchool">
                                <c:set var="safely" value="${safely},${volunteerSchool.schoolCode}"/>
                            </c:forEach>
                        </c:when>
                        <c:when test="${volunteer.vtype eq 'steady'}">
                            <c:set var="steady" value=""/>
                            <c:forEach items="${volunteer.volunteerSchoolList}" var="volunteerSchool">
                                <c:set var="steady" value="${steady},${volunteerSchool.schoolCode}"/>
                            </c:forEach>
                        </c:when>
                        <c:when test="${volunteer.vtype eq 'danger'}">
                            <c:set var="danger" value=""/>
                            <c:forEach items="${volunteer.volunteerSchoolList}" var="volunteerSchool">
                                <c:set var="danger" value="${danger},${volunteerSchool.schoolCode}"/>
                            </c:forEach>
                        </c:when>
                    </c:choose>
                </c:forEach>
            </c:when>
            <c:otherwise></c:otherwise>
        </c:choose>
        -->
        <ul class="topline">
            <li>
                <a href="#" onclick="schoolList('danger');">
                    <i class="icons icon-light"></i>
                    <div class="typedes">
                        <span class="type_title">冒险型志愿组合</span>
                        <span class="type_info">录取概率40%以下</span>
                    </div>
                    <div class="type-right">
                        <span class="type_num">5<i>所</i></span>
                        <span class="icon-arrow icon-next"></span>
                    </div>
                </a>
            </li>
            <li>
                <a href="#" onclick="schoolList('steady');">
                    <i class="icons icon-cafe"></i>
                    <div class="typedes">
                        <span class="type_title">稳妥型志愿组合</span>
                        <span class="type_info">录取概率40%-70%之间</span>
                    </div>
                    <div class="type-right">
                        <span class="type_num">5<i>所</i></span>
                        <span class="icon-arrow icon-next"></span>
                    </div>
                </a>
            </li>
            <li>
                <a href="#" onclick="schoolList('safely');">
                    <i class="icons icon-safe"></i>
                    <div class="typedes">
                        <span class="type_title">保底型志愿组合</span>
                        <span class="type_info">录取概率70%以上</span>
                    </div>
                    <div class="type-right">
                        <span class="type_num">5<i>所</i></span>
                        <span class="icon-arrow icon-next"></span>
                    </div>
                </a>
            </li>
        </ul>
    </section>
</div>
<div class="modal fade" id="scoreModal" tabindex="-1" role="dialog" aria-labelledby="scoreModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-body" style="text-align: center;">
                <input type="tel" name="score" id="score" class="form-control" placeholder="分数"
                       style="height: 50px;font-size: 20px;">
            </div>
            <div class="modal-footer" style="padding: 0px;border: none;">
                <button type="button" class="btn btn-primary" id="msgBtn"
                        style="width: 100%;line-height: 30px;border: none;border-radius: 0px;font-size: 18px;">提   交</button>
            </div>
        </div>
    </div>
</div>
<script src="${ctxStatic}/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/bootstrap/3.3.2/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("#msgBtn").click(function(){
            var userId = $("#userId").val();
            var score = $("#score").val();
            var url = "${wechat}/updateUserInfo";
            $.post(url,{
                "score":score,
                "userId":userId
            },function(data){
                if(data.success){
                    $("#scoreModal").modal("hide");
                    $(".scorebox i.score").text(score);
                }
            });
        });
    });
    function changeScore(userId){
        $("#scoreModal").modal();
    }

    function schoolList(type){
        /**
        var schoolCodes = "";
        if(type=="steady"){
            schoolCodes = "${steady}";
        }else if(type=="safely"){
            schoolCodes = "${safely}";
        }else{
            schoolCodes = "${danger}";
        }**/
        window.location.href = "${wechat}/schoolList?vtype="+type;
    }
</script>
</body>
</html>